from __future__ import print_function

import grpc

import pubsub_pb2
import pubsub_pb2_grpc


def run():
    channel = grpc.insecure_channel('localhost:50051')
    stub = pubsub_pb2_grpc.MasterStub(channel)
    response = stub.registerPublisher(pubsub_pb2.RegRequest(name='test'))
    print(response)
    stub = pubsub_pb2_grpc.MasterStub(channel)
    response = stub.registerSubscriber(pubsub_pb2.RegRequest(name='test'))
    print(response)


if __name__ == '__main__':
    run()